﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using Model.Common;

namespace Model.Catalog
{
    public class Category
    {
        public Category()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        //---------------------------------------
        //Select all category list
        public static DataTable GetAllCategories()
        {
            try
            {
                return DataAccess.GetData(null, null, "GetAllCategories");
            }
            catch
            {
                return null;
            }
        }

        //---------------------------------------
        //Select category details by CategoryId
        public static DataTable GetCategoriesByCategoryId(string CategoryId)
        {
            string[] paraName = {"@CategoryId" };
            object[] paraValue = { CategoryId };
            try
            {
                return DataAccess.GetData(paraName, paraValue, "GetCategoriesByCategoryId");
            }
            catch
            {
                return null;
            }
        }
        
    }
}
